import request from '@/utils/request'

// 用户登录
export function login(data) {
  return request({
    url: '/api/customers/login',
    method: 'post',
    data
  })
}

// 用户注册
export function register(data) {
  return request({
    url: '/api/customers',
    method: 'post',
    data
  })
}

// 获取用户信息
export function getUserInfo(id) {
  return request({
    url: `/api/customers/${id}`,
    method: 'get'
  })
}

// 更新用户信息
export function updateUserInfo(data) {
  return request({
    url: '/api/customers',
    method: 'put',
    data
  })
}

// 更新用户积分
export function updateUserPoints(id, points) {
  return request({
    url: `/api/customers/${id}/points`,
    method: 'put',
    params: { points }
  })
} 